
/** 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package com.tompai.datagather.tencent;

import com.tompai.datagather.model.CrawlDatum;

/**
* @desc: datagather-tools
* @name: TenArticalTask.java
* @author: tompai
* @createTime: 2018年5月2日 下午2:52:27
* @history:
* @version: v1.0
*/

public class TenArticalTask implements Runnable{

	private String url;
	
	private String content;
	private Integer commentNumber;
	private String author;
	private String responsEditor;
	
	@Override
	public void run() {
		//TODO Auto-generated method stub
		
		try {
			TenArticalCrawler crawler = new TenArticalCrawler(".temp/depth_crawler", true);
			crawler.addSeed(new CrawlDatum(getUrl())
	                .meta("depth", 1));
			crawler.start(1);
			//=======================
			setContent(crawler.getContent());
			setAuthor(crawler.getAuthor());
			setResponsEditor(crawler.getResponsEditor());
			
		} catch (Exception e) {
			
			//TODO Auto-generated catch block
			e.printStackTrace();
			
		}
	}
	
	/**
	* @return the url
	*/
	
	public String getUrl() {
	
		return url;
	}
	
	/**
	* @param url the url to set
	*/
	
	public void setUrl(String url) {
	
		this.url = url;
	}

	
	/**
	* @return the content
	*/
	
	public String getContent() {
	
		return content;
	}

	
	/**
	* @param content the content to set
	*/
	
	public void setContent(String content) {
	
		this.content = content;
	}

	
	/**
	* @return the commentNumber
	*/
	
	public Integer getCommentNumber() {
	
		return commentNumber;
	}

	
	/**
	* @param commentNumber the commentNumber to set
	*/
	
	public void setCommentNumber(Integer commentNumber) {
	
		this.commentNumber = commentNumber;
	}

	
	/**
	* @return the author
	*/
	
	public String getAuthor() {
	
		return author;
	}

	
	/**
	* @param author the author to set
	*/
	
	public void setAuthor(String author) {
	
		this.author = author;
	}

	
	/**
	* @return the responsEditor
	*/
	
	public String getResponsEditor() {
	
		return responsEditor;
	}

	
	/**
	* @param responsEditor the responsEditor to set
	*/
	
	public void setResponsEditor(String responsEditor) {
	
		this.responsEditor = responsEditor;
	}

}

